﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using OpenTK;
using OpenTK.Input;
using OpenTK.Graphics;
using System.Runtime.InteropServices;

#if EMBEDDED
    using OpenTK.Graphics.ES20;
#else
using OpenTK.Graphics.OpenGL;
#endif

namespace MonoSettlers.RenderSystem
{
    /// <summary>
    /// Just a wrapper for exceptions thrown by <see cref="GLRenderer.Check"/>.
    /// </summary>
    public class GLException : Exception
    {
        public GLException(ErrorCode inErrorCode)
            : this(inErrorCode, "OpenGL call failed unexpectedly.")
        {
        }

        public GLException(ErrorCode inErrorCode, String inMessage, params Object[] inArgs)
            : base(String.Format(inMessage, inArgs) + " (ErrorCode: " + inErrorCode + ")")
        {
        }

    }
}
